<%--
  Created by IntelliJ IDEA.
  User: 86131
  Date: 2021/8/21
  Time: 20:33
  To change this template use File | Settings | File Templates.
--%>

<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%--    完成数组编号对应星期几的案例--%>
<%--
    1.域中存储一个数字
    2.使用choose取出数字   相当于switch
    3.用when标签做判断       相当于case
    4.用otherwise标签做其他情况的声明   相当于default
--%>
    <%
        request.setAttribute("number",4);
    %>
    <c:choose>
        <c:when test="${number == 1}">星期一</c:when>
        <c:when test="${number == 2}">星期二</c:when>
        <c:when test="${number == 3}">星期三</c:when>
        <c:when test="${number == 4}">星期四</c:when>
        <c:when test="${number == 5}">星期五</c:when>
        <c:when test="${number == 6}">星期六</c:when>
        <c:when test="${number == 7}">星期天</c:when>
    </c:choose>
</body>
</html>
